#define _CRT_SECURE_NO_WARNINGS 1
#include"my_string.h"
namespace zlh
{
	void test_string1()
	{
		string s1;
		string s2("hello");
		//cout << s1.c_str() << endl;
		//cout << s2.c_str() << endl;
		//for (size_t i = 0; i < s2.size(); i++)
		//{
		//	s2[i] += 2;
		//}
		//cout << s2.c_str() << endl;
		////char* is = s2.begin();
		////while (is != s2.end())
		////{
		////	cout << *is << " ";
		////	++is;
		////}
		////cout << endl;
		////for (auto e : s2)
		////{
		////	cout << e << " ";
		////}
		//string::iterator it = s2.begin();
		//while (it != s2.end())
		//{
		//	cout << *it << " ";
		//	++it;
		//}
		//cout << endl;
		//for (auto e : s2)
		//{
		//	cout << e << " ";
		//}
		cout << s1.capacity() << endl;
		cout << s1.size() << endl;
		cout << s2.capacity() << endl;
		cout << s2.size() << endl;
		s1 += 'a';
		s1 += 'b';
		s1 += 'c';
		cout << s1.c_str() << endl;
		s1.append(" hello world");
		cout << s1.c_str() << endl;
		s1 += " ni hao";
		cout << s1.c_str() << endl;
		cout << s1 << s2 << endl;

	}
}
int main()
{
	zlh::test_string1();
	return 0;
}